package com.easycoding.ums.enumcode;

/**
 * <b>Description</b>:账户状态标志枚举<br/>
 * <b>Create Date</b>: 2013-3-28 下午3:14:38<br/>
 * <b>Version</b>: Since JDK 1.6.0<br/>
 * <b>Package</b>: com.easycoding.bocai.code
 */
public enum AccountStatus {
	
	/**启用*/
	OPEN(1,"启用"),
	/**停用*/
	CLOSE(0,"停用"),
	/**暂停*/
	PAUSE(2,"暂停");	
	
	private AccountStatus(int code,String name){
		this.code = code;
		this.name = name;
	}
	
	private int code;
	private String name;
	
	public int getCode() {
		return code;
	}
	public void setCode(int code) {
		this.code = code;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	/**
	 * 获取对应的中文名称  
	 * @param code 枚举值
	 * @return 枚举对应的中文名称
	 */
    public static String getName(int code) {   
        for (AccountStatus c : AccountStatus.values()) {   
            if (c.code == code) {   
                return c.name;   
            }   
        }   
        return null;   
    } 
    
    @Override  
    public String toString() {   
        return this.code+"="+this.name;   
    }  
}
